/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2022-10-01
 * Time: 16:50
 */
interface ISwimming{
    void swimming();
}
interface IRuning{
    void runing();
}
class Duck implements ISwimming,IRuning{
    public String name;

    public Duck(String name) {
        this.name = name;
    }


    @Override
    public void swimming() {
        System.out.println(this.name+"水里游");
    }

    @Override
    public void runing() {
        System.out.println(this.name+"地上跑");
    }
}
class Dog implements IRuning{
    public String name;

    public Dog(String name) {
        this.name = name;
    }
    @Override
    public void runing() {
        System.out.println(this.name+"水里游");
    }
}
public class Test1 {
    public static void func1(IRuning r){
        r.runing();
    }
    public static void func2(ISwimming s){
       s.swimming();
    }
    public static void main(String[] args) {
      func1(new Dog("大飞"));
      func1(new Duck("白糖"));
      func2(new Duck("白糖"));
    }

}
